<?php
class Cookie
{
	public static function setPid($pid)
	{
		$cookie = new CHttpCookie('pid', $pid);
		$cookie->expire = time()+60*30;  //有限期30天
		Yii::app()->request->cookies['pid'] = $cookie;
	}

	public static function getPid()
	{
		$cookie = Yii::app()->request->getCookies();
		if (isset($cookie['pid'])) {
			return $cookie['pid']->value;
		} else {
			return 'mm_15208748_4212023_13760107';
		}
	}
}
